package com.作业.Day11;

import java.util.Scanner;

public class OrderingStart {
    public static void main(String[] args) {
        System.out.println("欢迎使用”吃货联盟订餐系统“");
        OrderingUtil orderingUtil = new OrderingUtil();
        Scanner scanner = new Scanner(System.in);
        orderingUtil.initial();
        while (true) {
            orderingUtil.startMenu1();
            System.out.print("请选择");
            int i = scanner.nextInt();
            orderingUtil.select(i);
            if (i == 1) {
                System.out.println("输入送餐姓名");
                String name = scanner.next();
                orderingUtil.show();
                System.out.print("请输入菜名编号");
                int i1 = scanner.nextInt();
                System.out.println("请输入份数");
                int i2 = scanner.nextInt();
                System.out.println("请输入送餐时间");
                String timne = scanner.next();
                System.out.println("请输入送餐地址");
                String address = scanner.next();
                OrderingSet orderingSet = new OrderingSet(name, " ", timne, address, "已预定", " ");
                orderingUtil.add(i1, i2, orderingSet);
            } else if (i == 2) {
                orderingUtil.display();
            } else if (i == 3) {
                System.out.println("请输入签收的订单号");
                int i1 = scanner.nextInt();
                orderingUtil.sign(i1);
            } else if (i == 4) {
                orderingUtil.display();
                System.out.println("请输入删除订单");
                int i1 = scanner.nextInt();
                orderingUtil.delete(i1);
            } else if (i == 5) {
                orderingUtil.show();
                System.out.println("请输入你点赞后的菜品");
                int i1 = scanner.nextInt();
                orderingUtil.praise(i1);
            }
            else if (i == 6) {
                System.out.println("欢迎下次光临");
                break;
            }
            System.out.print("输入0返回");
            int i1 = scanner.nextInt();
            if (i1 == 0) {
                continue;
            }

        }

    }

}

